#!/bin/sh

cargo fmt -- --check \
    && cargo clippy --all-targets --all-features -- -D warnings \
    && RUSTDOCFLAGS="-D warnings" cargo doc \
    && cargo build \
    && cargo build --all-targets --all-features \
    && cargo build --examples \
    && ./target/debug/examples/getips \
    && ./target/debug/examples/route-list \
    && ./target/debug/examples/ctrl-list \
    && ./target/debug/examples/error_packet \
    && ./target/debug/examples/nl80211 \
    && cargo build --examples --features=async \
    && ./target/debug/examples/getips \
    && ./target/debug/examples/route-list \
    && ./target/debug/examples/ctrl-list \
    && ./target/debug/examples/error_packet \
    && ./target/debug/examples/nl80211 \
    && cargo test \
    && cargo test --all-targets --all-features \
    || exit 1

(cd neli-proc-macros \
    && cargo fmt -- --check \
    && cargo clippy -- -D warnings \
    && RUSTDOCFLAGS="-D warnings" cargo doc \
    && cargo build \
    && cargo test) \
    || exit 1
